<template>
    <view>
        <view class="item"
            v-for="i in news"
            :key="i.id"
            @tap="toNewsDetails(i)"
        >
            <view class="img">
                <view :class="i.c"></view>
            </view>
            <navigator class="info"  url="/pages/community/The-topic/topicDetails">
                <view class="name">{{ i.title }}</view>
                <view class="desc">
                {{i.content}}
                </view>
                <view class="iconfont icon-huo"></view>
            </navigator>
        </view>
    </view>
</template>
<style lang="scss" scoped>
.item {
    background-color: #ffffff;
    padding: 10rpx 0;
    display: flex;
    overflow: hidden;
    .img{
        flex: 1;
        width:60px;
        height: 60px;
        padding:3px 0px 10px 30px;
    }
    .info{
        flex :7;
        padding: 0px 0px 0px 30px;
        border-bottom: 1px #efefef solid;
        height: 60px;
            .name {
                font-size: 35rpx;
                color: #000;
                padding: 10rpx 0;
                width: 200px;
            }
            .desc {
                padding: 5rpx 5rpx;
                width: 200px;
                white-space: nowrap;
                overflow: hidden;
                text-overflow: ellipsis;
                color: #979797;
                font-size: 24rpx;
                margin: 5px 0;
            }
            
    }
    .iconfont icon-huo{
        flex: 1;
        padding: 10px 0;
        width: 10px;
    }
}
</style>
<script>
export default {
    data() {
        return {
        news: [
            {
            id: 0,
            title: "爱分享",
            content:
                "新鲜事，邻里事，小区见闻常分享",
            type: 1,
            c:"iconfont icon-tupian1"
            },
            {
            id: 1,
            title: "车位库房",
            content:
                "你出租，我求租，小绿来帮忙",
            type: 1,
            c:"iconfont icon-truck-full"
            },
            {
            id: 2,
            title: "组局活动",
            content:
                "运动棋牌、夜跑遛狗，左邻右舍约起来",
            type: 2,
            c:"iconfont icon-biaoqing"
            },
            {
            id: 3,
            title: "邻里互助",
            content:
                "出闲置、求阿姨，邻里互助更靠谱",
            type: 2,
            c:"iconfont icon-aixin"
            },
            {
            id: 4,
            title: "议事堂",
            content:
                "关系你我他，业主权益共主张",
            type: 2,
            c:"iconfont icon-17"
            },
            {
            id: 5,
            title: "红黑榜",
            content:
                "你说、我说、大家说，和谐小区共建设",
            type: 2,
            c:"iconfont icon-danzi"
            }
        ],
        indicatorDots: true,
        autoplay: true,
        interval: 2000,
        duration: 500,
        };
    },
    methods: {
        methods: {
            toDetails() {
            uni.navigateTo({
            url: "./topicDetails"
            });
            }
        }
    }
}
</script>